//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - SaaS Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================



using System;
using System.Collections.Generic;
using Shp.Runtime.Contract;
using Shp.Runtime.DataModel.Sitka;


namespace Shp.Runtime.Services
{
    static public class PresentationLogic
    {
        private static PresentationDataModel _dataModel = new PresentationDataModel();

        static public int GetConfiguredLayout(string tenantAlias)
        {
            return _dataModel.GetConfiguredLayout(tenantAlias);
        }

        static public Guid GetCurrentStyleId(Guid tenantId)
        {
            return _dataModel.GetCurrentStyleId(tenantId);
        }

        static public string GetConfiguredStyle(string tenantAlias)
        {
            return _dataModel.GetConfiguredStyle(tenantAlias);
        }

        static public StringPair[] GetMainMenu(string tenantAlias, bool isPublic)
        {
            return _dataModel.GetMainMenu(tenantAlias, isPublic);
        }

        static public KeyValuePair<int, string>[] GetLayoutList(Guid tenantId)
        {
            List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
            list.Add(new KeyValuePair<int, string>(0, "classic"));
            list.Add(new KeyValuePair<int, string>(1, "functional"));
            return list.ToArray();
        }

        static public KeyValuePair<Guid, string>[] GetStyleList(Guid tenantId)
        {
            return _dataModel.GetStyleList(tenantId);
        }

        static public void UpdatePresentation(Guid tenantId, int layout, Guid style)
        {
            _dataModel.UpdatePresentation(tenantId, layout, style);
        }

        static public void AddStyle(Guid tenantId, string name, Uri url)
        {
            _dataModel.AddStyle(tenantId, name, url);
        }

        static public MainMenuItem[] GetMainMenuList(Guid tenantId)
        {
            return _dataModel.GetMainMenuList(tenantId);
        }

        static public void UpdateMainMenu(Guid tenantId, MainMenuItem[] menuItems)
        {
            _dataModel.UpdateMainMenu(tenantId, menuItems);
        }
    }
}
